from django.conf.urls import url, include
from . import views

urlpatterns = [
    #1.注册页面
    url(r'^register/$', views. RegisterView.as_view(), name='register'),
    #2.用户名重复
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views. UsernameCountView.as_view(), name='usernamecount'),
    #3.手机号重复
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views. MobileCountView.as_view(), name='mobilecount'),
    #4.登录功能
    url(r'^login/$', views. LoginView.as_view(), name='login'),
    #5.退出登录
    url(r'^logout/$', views. LogoutView.as_view(), name='logout'),
    #6.个人中心
    url(r'^info/$', views. UserInfoView.as_view(), name='info'),
    #7.个人中心修改邮箱
    url(r'^emails/$', views. EmailView.as_view(), name='email'),
    #8.激活邮箱
    url(r'^emails/verification/$', views. VerifyEmailView.as_view(), name='verifyemail'),
    #9.显示收货地址
    url(r'^address/$', views. AddressView.as_view(), name='address'),
    # 10.新增地址
    url(r'^addresses/create/$', views.CreateAddressView.as_view(), name='create_address'),
    # 11.修改地址  逻辑删除地址
    url(r'^addresses/(?P<address_id>\d+)/$', views.UpdateDestroyAddressView.as_view(), name='update_address'),
    #12.修改默认地址
    url(r'^addresses/(?P<address_id>\d+)/default/$', views. DefaultAddressView.as_view(), name='default_address'),
    #13.修改标题 addresses/(?P<address_id>\d+)/title/
    url(r'^addresses/(?P<address_id>\d+)/title/$', views. UpdateTitleAddressView.as_view(), name='title_address'),
    #14.修改密码
    url(r'^password/$', views. ChangePwdView.as_view(), name='changepwd'),
    # 15.浏览记录
    url(r'^browse_histories/$', views.HistoryBrowseView.as_view(), name='history'),

]
